from scrapy.contrib.spiders import Rule

class MyRule(Rule):
    def __init__(self,link_extractor, callback=None, cb_kwargs=None, follow=None, process_links=None, process_request=None):
        self.link_extractor = link_extractor
        self.callback = callback
        self.cb_kwargs = cb_kwargs or {}
        self.process_links = process_links
        self.process_request = process_request
        if follow is None:
            self.follow = False if callback else True
        else:
            self.follow = follow
            
    def process_links(self,links):
        follows = ["http://my.nuaa.edu.cn/portal.php"]
        
        # code here
        return follows